package com.yanqu.road.server.timer.activity;

import com.yanqu.road.server.manger.activity.busyfarming.BusyFarmingMgr;
import com.yanqu.road.utils.executor.GeneralTask;

public class BusyFarmingTask extends GeneralTask {

    private long lastSyncTime;

    public static final int SYNC_TIME = 20 * 1000;      //每20S同步一次

    @Override
    public void doRun() {

        long nowTime = System.currentTimeMillis();
        if (nowTime - lastSyncTime > SYNC_TIME) {

            BusyFarmingMgr.calUserLandState();

            BusyFarmingMgr.uploadUserData();

            lastSyncTime = nowTime;
        }

    }
}
